home *** CD-ROM | disk | FTP | other *** search
- function EatErrors(szMsg, szUrl, iLine)
- {
- alert("An unexpected error occurred.\n\n" + szMsg + "\n" + szUrl + "\nLine: " + iLine);
- window.event.returnValue = true;
- }
- function LoadScriptFile(szScriptID, szUrl)
- {
- if (null == g_docAll(szScriptID))
- {
- var elemScript = document.createElement("<SCRIPT id=" + szScriptID + " src='" + szUrl + "' language='javascript'></SCRIPT>");
- if (elemScript)
- {
- document.body.insertBefore(elemScript);
- }
- }
- }
- function Dso_IsRestricted(szPolicy)
- {
- var bResult;
- bResult = g_docAll.idCtlAppsDso.IsRestricted(szPolicy);
-
-
- return bResult;
- }
- function _ParseCmdLine()
- {
- var szCmdLine = g_docAll.idAppARP.commandLine;
- var ichParam = szCmdLine.indexOf("default.hta") + 12;
- var cch = szCmdLine.length;
- while (ichParam < cch)
- {
- if (szCmdLine.charAt(ichParam) != ' ')
- break;
- ichParam++;
- }
- var nPage = parseInt(szCmdLine.charAt(ichParam));
- if (isNaN(nPage) || 2 < nPage)
- nPage = g_iPageDefault;
- g_docAll.idPlaces.currentButton = nPage;
- }
- function _InitPlacesBar()
- {
- var _idPlaces = g_docAll.idPlaces;
- if (Dso_IsRestricted("NoRemovePage"))
- {
- _idPlaces.ShowButton('idChangeRemove', false);
- g_iPageDefault++;
- }
- if (Dso_IsRestricted("NoAddPage"))
- {
- _idPlaces.ShowButton('idAdd', false);
- if (1 == g_iPageDefault)
- g_iPageDefault++;
- }
- if (Dso_IsRestricted("NoWindowsSetupPage"))
- {
- _idPlaces.ShowButton('idConfig', false);
- if (2 == g_iPageDefault)
- g_iPageDefault++;
- }
- }
- function Body_OnLoad()
- {
- window.onerror = EatErrors;
- if (document.dir == "rtl")
- {
- g_docAll.idTdClose.align = "left";
- g_docAll.idTdCDFloppy.align = "left";
- g_docAll.idTdWindowsUpdate.align = "left";
- }
- document.body.onkeydown = Body_OnKeyDown;
- g_docAll.idBtnClose.onclick = _CloseWindow;
- var bExecOCMgr;
- bExecOCMgr = !g_docAll.idCtlAppsDso.ShowPostSetup;
- if (Dso_IsRestricted("ShowPostSetup"))
- bExecOCMgr = false;
- else if (Dso_IsRestricted("NoServices"))
- bExecOCMgr = true;
- var _idPlaces = g_docAll.idPlaces;
- _idPlaces.SetExecButton("idConfig", bExecOCMgr);
- g_docAll.idColPlaces.width = g_docAll.idPlaces.offsetWidth;
- g_docAll.idImgDummy1.width = g_docAll.idPlaces.offsetWidth;
- g_docAll.idImgDummy2.width = g_docAll.idPlaces.offsetWidth;
- g_docAll.idImgDummy3.width = g_docAll.idPlaces.offsetWidth;
- _ParseCmdLine();
- }
- function Body_OnKeyDown()
- {
- if (KC_F5 == event.keyCode)
- {
- switch (g_idCur)
- {
- case 'idChangeRemove':
- Dso_Refresh("Remove");
- break;
- case 'idAdd':
- Dso_Refresh("Categories");
- Dso_Refresh("Add");
- break;
- case 'idConfig':
- Dso_Refresh("ocsetup");
- break;
- }
- event.returnValue=false;
- }
- }
- function _CloseWindow()
- {
- window.parent.close();
- }
- function _SetPage(idElem)
- {
- switch (idElem)
- {
- case 'idChangeRemove':
- LoadScriptFile("idScriptRemove", "remove.js");
- break;
- case 'idAdd':
- LoadScriptFile("idScriptAdd", "add.js");
- break;
- case 'idConfig':
- LoadScriptFile("idScriptConfig", "config.js");
- break;
- }
- switch (g_idCur)
- {
- case 'idChangeRemove':
- Remove_Deactivate();
- break;
- case 'idAdd':
- Add_Deactivate();
- break;
- case 'idConfig':
- Config_Deactivate();
- break;
- }
- switch (idElem)
- {
- case 'idChangeRemove':
- Remove_Activate();
- break;
- case 'idAdd':
- Add_Activate();
- break;
- case 'idConfig':
- Config_Activate(false);
- break;
- }
- g_idCur = idElem;
- }
- function Places_OnExecItem()
- {
- var idElem = window.event.srcID;
- if ('idConfig' == idElem)
- {
- LoadScriptFile("idScriptConfig", "config.js");
- Config_Activate(true);
- }
- }
- function Places_OnSelectItem()
- {
- if (g_idCur == window.event.srcID)
- {
- switch (g_idCur)
- {
- case 'idChangeRemove':
- Remove_SetFocus();
- break;
- case 'idAdd':
- Add_SetFocus();
- break;
- case 'idConfig':
- Config_SetFocus();
- break;
- }
- return;
- }
- _SetPage(window.event.srcID);
- }
- function Places_OnComplete()
- {
- if ("undefined" == typeof g_docAll)
- g_docAll = document.all;
- _InitPlacesBar();
- }
- var KC_SPACE = 32;
- var KC_RETURN = 13;
- function _OnKeyDownFakeAnchor()
- {
- var keyCode = window.event.keyCode;
- if (KC_SPACE == keyCode || KC_RETURN == keyCode)
- {
- window.event.srcElement.click();
- }
- }
-